This way external programs like rpm-ostree can do fd-relative
operations on the deployment directories, like inspecting the RPM
database.
Closes: https://github.com/GNOME/ostree/pull/91
ostree_sysroot_new_default
ostree_sysroot_get_path
ostree_sysroot_load
+ostree_sysroot_get_fd
ostree_sysroot_ensure_initialized
ostree_sysroot_get_bootversion
ostree_sysroot_get_subbootversion
return TRUE;
}
+/**
+ * ostree_sysroot_get_fd:
+ * @self: Sysroot
+ *
+ * Access a file descriptor that refers to the root directory of this
+ * sysroot. ostree_sysroot_load() must have been invoked prior to
+ * calling this function.
+ *
+ * Returns: A file descriptor valid for the lifetime of @self
+ */
+int
+ostree_sysroot_get_fd (OstreeSysroot *self)
+{
+ g_return_val_if_fail (self->sysroot_fd != -1, -1);
+ return self->sysroot_fd;
+}
+
/**
* ostree_sysroot_ensure_initialized:
* @self: Sysroot
GFile *ostree_sysroot_get_path (OstreeSysroot *self);
+int ostree_sysroot_get_fd (OstreeSysroot *self);
+
gboolean ostree_sysroot_load (OstreeSysroot *self,
GCancellable *cancellable,
GError **error);